home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_chaseupper.cog < prev    next >
Text File  |  1999-11-15  |  11KB  |  342 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SOL_ChaseUpper.cog
  4. #
  5. # Triggered by entering upper oil shed room.
  6. #
  7. # [TRM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message     startup
  15.     message     user0
  16.     message     user1
  17.     message     user2
  18.     message     entered
  19.     
  20.     # ** Local Things **
  21.     thing       player          local
  22.     thing       comCar
  23.     thing       car             local
  24.     
  25.     # ** Ghost Objects **
  26.     thing       ghost_Com1
  27.     thing       ghost_Com2
  28.     
  29.     # ** Oil Shed Commies **
  30.     thing       os_Com1         local
  31.     thing       os_Com2         local
  32.     
  33.     # ** Cameras **
  34.     thing       os_cam1
  35.     thing       os_cam2
  36.     thing       os_cam3
  37.     
  38.     thing       ec_cam1
  39.     
  40.     thing       rp_Cam1
  41.     thing       rp_Cam2
  42.     thing       rp_Cam3
  43.     
  44.     # ** Camera Targets **
  45.     thing       os_CamTarg1
  46.     thing       os_CamTarg2
  47.     thing       os_CamTarg3
  48.     
  49.     thing       ec_CamTarg1
  50.     
  51.     # ** AI Targets **
  52.     thing       os_Com1Targ
  53.     thing       os_Com2Targ
  54.     thing       os_comTempTarg
  55.     
  56.     # ** Misc. Things **
  57.     thing       chase_Exp1
  58.     thing       chase_Exp2
  59.     thing       teleport1
  60.     
  61.     # ** Player Trigger Surfaces **
  62.     surface     trig_Upper          # start cutscene
  63.     surface     trig_CamCut1
  64.     surface     trig_CamCut2
  65.     surface     trig_CamCut3
  66.     surface     trig_Reflec1
  67.     surface     trig_Reflec2
  68.     surface     trig_Reflec3
  69.     surface     trig_Ready
  70.     
  71.     # ** Misc. surfaces **
  72.     surface     switch3
  73.     
  74.     # ** Templates **
  75.     template    tpl_Com1=khaki_mauser           local
  76.     template    tpl_Com2=khaki_mauser           local
  77.     template    tpl_Explode=+dummy_bazooka      local
  78.     
  79.     # ** music **
  80.     sound       mus_ComEnt=mus_sol_minechase.wav        local
  81.     
  82.     # ** types **
  83.     AI            ai_sniper=com_2Hsniper.ai        local
  84.     
  85.     # ** COGs **
  86.     cog     os_mineDoors1
  87.     cog     chaseBlowIt
  88.     cog     chase1doors
  89.     cog     camReflec
  90.     cog     chaseLower
  91.     cog     comControl
  92.     
  93.     # ** Ints **
  94.     int     curCam          local
  95.     int     ready=0         local
  96.     int     done=0          local
  97.     int     secondLap=0     local
  98.     int     ready=0         local
  99.     int     blownUp=0       local
  100.     
  101. end
  102.  
  103. # ========================================================================================
  104.  
  105. code
  106.  
  107. startup:
  108.  
  109.     # hide comCar
  110.     SetThingFlags(comCar, 0x80000);
  111.     
  112.     return;
  113.     
  114. # ========================================================================================
  115.  
  116. user0:
  117.  
  118.     blownUp = 1;
  119.     return;
  120.     
  121. # ========================================================================================
  122.  
  123. user1:
  124.  
  125.     done = 0;
  126.     return;
  127.     
  128. # ========================================================================================
  129.  
  130. user2:
  131.  
  132.     secondLap = 1;
  133.     return;
  134.  
  135. # ========================================================================================
  136.     
  137. entered:
  138.         
  139.     player = GetLocalPlayerThing();
  140.     curCam = GetCurrentCamera();
  141.     car = GetSourceRef();
  142.     
  143.     if((BitTest(GetPhysicsFlags(car), 0x01000000)) && (blownUp == 0))
  144.     {
  145.         # need to take one more lap
  146.         if((done == 0) && (secondLap == 0) && (ready == 0))
  147.         {
  148.             if(GetSenderRef() == trig_Upper)
  149.             {
  150.                 secondLap = 1;
  151.                 
  152.                 # disable camReflec temporarily
  153.                 SendMessage(camReflec, user0);
  154.                 
  155.                 # tell chaseLower that secondLap = 1
  156.                 SendMessage(chaseLower, user2);
  157.                 
  158.                 # tell comControl to show switch4 and switch5 commies
  159.                 SendMessage(comControl, user0);
  160.             }
  161.         }
  162.         
  163.         else if((ready == 0) && (done == 0) && (secondLap == 1))
  164.         {
  165.             if(GetSenderRef() == trig_Ready)
  166.             {
  167.                 ready = 1;
  168.             }
  169.         }   
  170.         
  171.         else if((done == 0) && (secondLap == 1) && (ready == 1) && (GetWallCel(switch3) == 1))
  172.         {
  173.             if(GetSenderRef() == trig_Reflec1)
  174.             {
  175.                 # disable player and start cutscene
  176.                 StartCutscene(0);
  177.                 SetActorFlags(player, 0x200000);
  178.                 
  179.                 # Cut to rp_Cam1
  180.                 SetCameraFocus(2, rp_Cam1);
  181.                 SetCameraSecondaryFocus(2, player);
  182.                 SetCurrentCamera(2);
  183.             }
  184.                 
  185.             else if(GetSenderRef() == trig_Reflec2)
  186.             {
  187.                 # Cut to rp_Cam2
  188.                 SetCameraFocus(2, rp_Cam2);
  189.                 SetCameraSecondaryFocus(2, player);
  190.                 SetCurrentCamera(2);
  191.             }
  192.             
  193.             else if(GetSenderRef() == trig_Reflec3)
  194.             {
  195.                 # Cut to rp_Cam3
  196.                 SetCameraFocus(2, rp_Cam3);
  197.                 SetCameraSecondaryFocus(2, player);
  198.                 SetCurrentCamera(2);
  199.             }
  200.             
  201.             # fire up the main cutscene
  202.             else if(GetSenderRef() == trig_Upper)
  203.             {
  204.                 # temporary spot for holding mine doors open
  205.                 SendMessage(chase1doors, user2);
  206.                 
  207.                 # tell chaseBlowIt that sender is comCar_Upper
  208.                 SendMessage(chaseBlowIt, user0);
  209.                 
  210.                 # enable chaseBlowIt
  211.                 SendMessage(chaseBlowIt, user1);
  212.                 
  213.                 # stop player
  214.                 StopThing(player);
  215.                 
  216.                 # cut to comcar entering thru lower oil shed door
  217.                 SetCameraFocus(2, os_cam1);
  218.                 SetCameraSecondaryFocus(2, os_CamTarg1);
  219.                 SetCurrentCamera(2);
  220.                 
  221.                 # show comCar
  222.                 ClearThingFlags(comCar, 0x80000);
  223.                 
  224.                 # rest for a bit if necessary and then set thrust
  225.                 Sleep(0.1);
  226.                 SetThingThrust(comCar, '0.0 2.5 0.0');
  227.                     
  228.                 # create first two oil shed commies
  229.                 os_Com1 = CreateThing(tpl_Com1, ghost_Com1);
  230.                 CaptureThing(os_Com1);
  231.                 os_Com2 = CreateThing(tpl_Com2, ghost_Com2);
  232.                 CaptureThing(os_Com2);
  233.                 
  234.                 # prepare oil shed commies for cutscene
  235.                 AISetCutsceneMode(os_Com1);    
  236.                 AISetCutsceneMode(os_Com2);
  237.                 
  238.                 # open mine safety doors
  239.                 SendMessage(os_mineDoors1, user0);
  240.                 
  241.                 # play com entrance music
  242.                 PlaySoundLocal(mus_ComEnt, 1.0, 0.0, 0x0, 0);
  243.  
  244.                 # send os_com1 running in after comCar
  245.                 AISetMoveSpeed(os_com1, 4.0);
  246.                 AISetLookThing(os_com1, os_comTempTarg);
  247.                 AISetMoveThing(os_com1, os_comTempTarg, 0);
  248.                 
  249.                 # send os_com2 running in after comCar.
  250.                 AISetMoveSpeed(os_com2, 4.0);
  251.                 AISetLookThing(os_com2, os_com2Targ);
  252.                 AISetMoveThing(os_com2, os_comTempTarg, 1);
  253.                 AISetMoveThing(os_com2, os_com2Targ, 1);
  254.                 
  255.                 AISetLookThing(os_com1, os_com1Targ);
  256.                 AISetMoveThing(os_com1, os_com1Targ, 1);
  257.                 
  258.                 # close mine safety doors
  259.                 SendMessage(os_mineDoors1, user1);
  260.                 
  261.                 # give player some thurst
  262.                 SetThingThrust(player, '0.0 3.0 0.0');
  263.                 
  264.                 # slow down comCar
  265.                 SetThingThrust(comCar, '0.0 2.0 0.0');
  266.                 
  267.                 # rest for a bit if necessary
  268.                 Sleep(0.5);
  269.                 
  270.                 # cut to shot of player on upper 
  271.                 # track and comCar on lower track
  272.                 SetCameraFocus(2, os_cam2);
  273.                 SetCameraSecondaryFocus(2, os_CamTarg2);
  274.                 SetCurrentCamera(2);
  275.                 
  276.                 # destroy commies
  277.                 DestroyThing(os_Com1);
  278.                 DestroyThing(os_Com2);
  279.             }
  280.             
  281.             else if(GetSenderRef() == trig_CamCut1)
  282.             {
  283.                 # cut to camera at base of upper tracks to show
  284.                 # player and comCar racing towards exit.
  285.                 SetCameraFocus(2, os_Cam3);
  286.                 SetCameraSecondaryFocus(2, os_CamTarg3);
  287.                 SetCurrentCamera(2);
  288.                 
  289.                 # speed up comCar
  290.                 SetThingThrust(comCar, '0.0 3.0 0.0');
  291.             }
  292.             
  293.             else if(GetSenderRef() == trig_CamCut2)
  294.             {
  295.                 # cut to exit complex camera to show player and
  296.                 # comCar bursting thru mine doors.
  297.                 SetCameraFocus(2, ec_Cam1);
  298.                 SetCameraSecondaryFocus(2, ec_CamTarg1);
  299.                 SetCurrentCamera(2);
  300.                 
  301.                 # speed up comCar
  302.                 SetThingThrust(comCar, '0.0 5.0 0.0');
  303.             }
  304.             
  305.             else if(GetSenderRef() == trig_CamCut3)
  306.             {
  307.                 # cut to merge cam to show comCar zipping in
  308.                 # front of player.
  309.                 TeleportThing(comCar, teleport1);
  310.                 Sleep(0.1);
  311.                 
  312.                 # slow down comCar
  313.                 SetThingThrust(comCar, '0.0 3.5 0.0');
  314.                 
  315.                 # match player speed with comCar
  316.                 SetThingThrust(player, '0.0 3.5 0.0');
  317.                 
  318.                 # turn camReflec back on
  319.                 SendMessage(camReflec, user1);
  320.                 
  321.                 # restore player control
  322.                 ClearActorFlags(player, 0x200000);
  323.                 SetCurrentCamera(1);
  324.                 EndCutscene();
  325.                 
  326.                 done = 1;
  327.                 
  328.                 Sleep(2.0);
  329.                 CreateThing(tpl_Explode, chase_Exp1);
  330.                 Sleep(2.0);
  331.                 CreateThing(tpl_Explode, chase_Exp2);
  332.             }
  333.         }
  334.     }
  335.     
  336.     return;
  337.         
  338. # ========================================================================================
  339.  
  340. end
  341.  
  342.